import request from '../utils/request';

export async function getCode(body) {
  return request('/api/global/code', {
    method: 'POST',
    body,
  });
}
export async function getModel(body) {
  return request('/api/global/model', {
    method: 'POST',
    body,
  });
}
export async function getZone() {
  return request('/api/global/cities/get', {
    method: 'POST',
  });
}
export async function createPic(body) {
  return request('/api/global/pic/create', {
    method: 'POST',body
  });
}
export async function deletePic(body) {
  return request('/api/global/pic/delete', {
    method: 'POST',body
  });
}
export async function findPicMany(body) {
  return request('/api/global/pic/find/many', {
    method: 'POST',body
  });
}
/**
 * 以下未确定是否使用
 * @param body
 * @returns {Promise<unknown>}
 */



export async function getOrderHistory(body) {
  return request('/api/global/history/order/get', {
    method: 'POST',
    body,
  });
}
export async function getBacklog(body) {
  return request('/api/global/backlog/get', {
    method: 'POST',
    body,
  });
}

export async function myHistory(body) {
  return request('/api/global/process/history', {
    method: 'POST',
    body,
  });
}


export async function addTableColumn(body) {
  return request('/api/global/table/column/add', {
    method: 'POST',
    body,
  });
}

export async function createData(body) {
  return request('/api/global/data/create', {
    method: 'POST',
    body,
  });
}

export async function createDataBatch(body) {
  return request('/api/global/data/create/batch', {
    method: 'POST',
    body,
  });
}

export async function findByWhere(body) {
  return request('/api/global/data/find', {
    method: 'POST',
    body,
  });
}

export async function updateByWhere(body) {
  return request('/api/global/data/update', {
    method: 'POST',
    body,
  });
}

export async function deleteByWhere(body) {
  return request('/api/global/data/delete', {
    method: 'POST',
    body,
  });
}



export async function queryBaseData(params) {
  return request('/api/base/data/query', {
    method: 'POST',
    body: params,
  });
};

// export async function getBaseDeviceDriveList() {
//   return request('/api/base/device/drive/list', {
//     method: 'GET',
//   });
// }

// export async function setDynamicLabel(body) {
//   return request('/api/dynamic/label/replace/batch', {
//     method: 'POST',
//     body
//   });
// }

// export async function getDynamicLabel(body) {
//   return request('/api/dynamic/label/query', {
//     method: 'POST',
//     body
//   });
// }
// export async function deleteDynamicLabel(body) {
//   console.log('deleteDynamicLabel',body)
//   return request('/api/dynamic/label/delete', {
//     method: 'POST',
//     body
//   });
// }
export async function getDigitalDict() {
  return request('/api/digital/dict/find/all', {
    method: 'GET',

  });
}
